In a case of providing a page of a main memory to a process, an operating system (OS) provides the page after zero-clearing the page. Here, the page is a management unit of the main memory. For each page, reading from the main memory to a cache memory is performed. A main purpose of the zero-clearing is to destroy a content of the main memory. By providing the page while destroying the content of the main memory, the OS avoids that information of a previous user is leaked to a subsequent user.
The zero-clearing is processing useful for the security of a system. However, the zero-clearing is processing that consumes a lot of central processing unit (CPU) time. In some cases, the CPU time accounts for 20% of the execution time of an application. Therefore, in a program that requests high-speed performance, it becomes important to reduce time taken for the zero-clearing.
As methods of the related art for zero-clearing, there are two methods. FIG. 11A is a diagram for explaining a first method for the zero-clearing. FIG. 11B is a diagram for explaining a second method for the zero-clearing.
As illustrated in FIG. 11A, in the first method, if a process uses a page for the first time and a page fault occurs (1), a memory handler of the OS allocates a page (2) and zero-clears the page (3). In addition, the OS restores processing of the process (4).
As illustrated in FIG. 11B, in the second method, the OS preliminarily zero-clears and stores pages (1) and if a process uses a page for the first time and a page fault occurs (2), the memory handler allocates a zero-cleared page (3). In addition, the OS restores processing of the process (4).
There is a method in which the first method and the second method are combined. Furthermore, there is a technique in which in a case where zero-clearing for a page of a memory is specified, zero-clearing information is stored for the relevant page of the memory while not zero-clearing the relevant page and an access to the relevant page is controlled based on the zero-clearing information, thereby reducing processing time. There is a technique in which if initial reference is generated in a new page in a virtual storage management system, a page frame is allocated and a paging subsystem initially sets to zero. As Related arts, for example, Japanese Laid-open Patent Publication No. 10-3423 and Japanese Laid-open Patent Publication No. 63-025747 are disclosed.
However, in the methods of the related art for the zero-clearing, there is a problem that the processing of a process is stopped during the processing of the zero-clearing. In the first method, the zero-clearing is performed only after a usage request is issued from a process. Therefore, a time cost ranged from when a process causes a page fault to when being able to be restored becomes very high.
In the second method, if zero-cleared pages disappear, processing for the zero-clearing becomes desirable. In the second method, there is a problem such as how to charge the zero-clearing processing for CPU time. From the above, it is desirable to be able to reduce stop time of a process at the time of page allocation.